package com.sprinboot_vue.blog_springboot.result;

import lombok.Data;

/**
 * @author Thomas
 * @version 1.0
 * @date 2021/11/20 21:03
 */
//枚举类不能使用@Data
public enum ResultInfo {
    SUCCESS("200","操作成功!"),
    ERROR("404","未知错误!"),
    INSERT("200","添加成功!"),
    DELETE("200","删除成功!"),
    FIND("200","查询成功!")
    ;

    //返回状态码
    private String code;
    //返回信息
    private String message;

    //定义有参构造器
    ResultInfo(String code,String message){
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
